<html>
<head>
  <title>17-InnoDB的Buffer Pool</title>
  <basefont face="微软雅黑" size="2" />
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <meta name="exporter-version" content="YXBJ Windows/600646 (zh-CN, DDL); Windows/6.1.1 (Win64);"/>
  <meta name="content-class" content="yinxiang.markdown"/>
  <style>
    body, td {
      font-family: 微软雅黑;
      font-size: 10pt;
    }
  </style>
</head>
<body>
<a name="895"/>
<h1>17-InnoDB的Buffer Pool</h1>

<div><span><div style="font-size: 14px; margin: 0; padding: 0; width: 100%;"><h2 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 34px; border-bottom: 1px solid #dbdbdb; color: #333;">1 缓存的重要性</h2>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">当需要访问某个页的数据时，就会把完整的页的数据全部加载到内存中，也就是说即使只需要访问一个页的一条记录，也需要先把整个页的数据全部加载到内存中。将整个页加载到内存中后就可以进行读写访问了，在进行完读写访问之后并不着急把该页对应的内存释放掉，而是将其缓存起来，这样将来有请求再次访问该页面时，就可以省去磁盘IO的开销了。</p>
<h2 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 34px; border-bottom: 1px solid #dbdbdb; color: #333;">2 InnoDB的Buffer Pool</h2>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">在MySQL服务器启动时，向操作系统申请了一片连续的内存，叫做<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Buffer Pool（缓冲池）</strong>。<br/>
Buffer Pool的默认大小是128M，最小值是5M，可以通过在启动服务器时配置<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">innodb_buffer_pool_size</strong>参数的值：<br/>
<img src="17-InnoDB的Buffer Pool_files/Image.png" type="image/png" data-filename="Image.png"/></p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-1 Buffer Pool内部组成</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">Buffer Pool中默认的<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">缓存页</strong>大小和在磁盘上默认的页大小一样，都是16KB。为了管理缓存页，每个缓存页对应一个<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">控制块</strong>，控制块中存储了对应缓存页所属的表空间编号、页号、缓存页在Buffer Pool中的地址、链表节点信息、锁的信息以及LSN信息等。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">它们都被存放到Buffer Pool中，其中控制块被存放到Buffer Pool的前面，缓存页被存放到Buffer Pool的后面：<img src="17-InnoDB的Buffer Pool_files/1.jpg" type="image/jpeg" data-filename="1.jpg"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">小贴士： 每个控制块大约占用缓存页大小的5%，在MySQL5.7.21这个版本中，每个控制块占用的大小是808字节。而我们设置的innodb_buffer_pool_size并不包含这部分控制块占用的内存空间大小，也就是说InnoDB在为Buffer Pool向操作系统申请连续的内存空间时，这片连续的内存空间一般会比innodb_buffer_pool_size的值大5%左右。</p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-2 free链表的管理</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">当磁盘上的页需要被缓存到Buffer Pool中时，需要知道该放到哪个缓存页的位置（Buffer Pool中哪些缓存页是空闲的）？<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">可以把所有空闲的缓存页对应的控制块作为一个节点放到一个链表中</strong>，这个链表可以被称为<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">free链表（空闲链表）</strong>。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">刚刚完成初始化的Buffer Pool中所有的缓存页都是空闲的，所以每一个缓存页对应的控制块都会被加入到free链表中，假设该Buffer Pool中可容纳的缓存页数量为n，那增加了free链表的效果图就是这样的：<br/>
<img src="17-InnoDB的Buffer Pool_files/1 [1].jpg" type="image/jpeg" data-filename="1.jpg"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">从图中可以看出，我们为了管理好这个free链表，特意为这个链表定义了一个基节点，里边儿包含着链表的头节点地址，尾节点地址，以及当前链表中节点的数量等信息。这里需要注意的是，链表的基节点占用的内存空间并不包含在为Buffer Pool申请的一大片连续内存空间之内，而是单独申请的一块内存空间。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">小贴士： 链表基节点占用的内存空间并不大，在MySQL5.7.21这个版本里，每个基节点只占用40字节大小。后边我们即将介绍许多不同的链表，它们的基节点和free链表的基节点的内存分配方式是一样一样的，都是单独申请的一块40字节大小的内存空间，并不包含在为Buffer Pool申请的一大片连续内存空间之内。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">有了这个free链表之后事儿就好办了，每当需要从磁盘中加载一个页到Buffer Pool中时，就从free链表中取一个空闲的缓存页，并且把该缓存页对应的控制块的信息填上（就是该页所在的表空间、页号之类的信息），然后把该缓存页对应的free链表节点从链表中移除，表示该缓存页已经被使用了。</p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-3 缓存页的哈希处理</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">缓存页在Buffer Pool中是存储在哈希表中的，<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">缓存页的 表空间号 + 页号 是哈希表中的key</strong>，<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">缓存页 是哈希表中的value</strong>。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">在需要访问某个页的数据时，先从哈希表中根据表<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">空间号 + 页号</strong>看看有没有对应的缓存页，如果有，直接使用该缓存页就好，如果没有，那就从<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">free链表</strong>中选一个空闲的缓存页，然后把磁盘中对应的页加载到该缓存页的位置。</p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-4 flush链表的管理</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">如果Buffer Pool中的某个缓存页的数据被修改了，那它就和磁盘上的页不一致了，这样的缓存页也被成为<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">脏页（dirty page）</strong>。如果每发生一次修改就立即同步到磁盘上对应的页上，那么频繁地往磁盘中写数据会严重影响程序的性能。所以每次修改缓存页后，不是立即把修改的页同步到磁盘上，而是把修改过的缓存页对应的控制块都会作为一个节点加入到一个链表中，因为这个链表节点对应的缓存页都是需要被刷新到磁盘上的，所以也叫<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">flush链表</strong>。<br/>
<img src="17-InnoDB的Buffer Pool_files/1 [2].jpg" type="image/jpeg" data-filename="1.jpg"/></p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-5 LRU链表的管理</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">Buffer Pool对应的内存大小是有限的，如果需要缓存的页占用的内存大小超过了Buffer Pool大小（free链表中没有多余的空间缓存页），那么需要从将不常访问的缓存页从Buffer Pool中移除，把新的页加载进来，以提高<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">缓存命中率</strong>。</p>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">2-5-1 简单的LRU链表</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">LRU链表（Least Recently Used）</strong>：按照最近最少使用的原则去淘汰缓存页的链表。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">当需要访问磁盘中的某个页时：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">如果该页<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">不在Buffer Pool</strong>中，在把该页从磁盘加载到Buffer Pool中的缓存页时，就把该缓存页对应的控制块作为节点塞到<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">LRU链表的头部</strong>；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">如果该页已经缓<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">存在在Buffer Pool</strong>中，则直接把该页对应的<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">控制块</strong>移动到LRU链表的头部。<br/>
只要使用到某个缓存页时，就把该缓存页调整到LRU链表的头部，这样LRU链表尾部就是最近最少使用的缓存页，当Buffer Pool中的空闲缓存页用完时，就到LRU链表的尾部找些缓存页淘汰。</li>
</ul>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">2-5-2 划分区域的LRU链表</h4>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">情况1：InnoDB提供了一个服务——<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">预读（英文名：read ahead）</strong>。所谓预读，就是InnoDB认为执行当前的请求可能之后会读取某些页面，就预先把它们加载到Buffer Pool中。根据触发方式的不同，预读又可以细分为下边两种：<br/>
a. 线性预读：InnoDB提供了一个全局系统变量<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">innodb_read_ahead_threshold</strong>，如果顺序访问了某个区（extent）的页面超过这个系统变量的值，就会触发一次异步读取下一个区中全部的页面到Buffer Pool的请求，注意异步读取意味着从磁盘中加载这些被预读的页面并不会影响到当前工作线程的正常执行。这个<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">innodb_read_ahead_threshold</strong>系统变量的值默认是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">56</strong>，我们可以在服务器启动时通过启动参数或者服务器运行过程中直接调整该系统变量的值；<br/>
b. 随机预读：如果Buffer Pool中已经缓存了某个区的13个连续的页面，不论这些页面是不是顺序读取的，都会触发一次异步读取本区中所有其的页面到Buffer Pool的请求。设计InnoDB的大叔同时提供了<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">innodb_random_read_ahead</strong>系统变量，它的默认值为OFF，也就意味着InnoDB并不会默认开启随机预读的功能，如果我们想开启该功能，可以通过修改启动参数或者直接使用SET GLOBAL命令把该变量的值设置为ON。<br/>
预读本来是个好事儿，如果预读到Buffer Pool中的页成功的被使用到，那就可以极大的提高语句执行的效率。可是如果用不到呢？这些预读的页都会放到LRU链表的头部，但是如果此时Buffer Pool的容量不太大而且很多预读的页面都没有用到的话，这就会导致处在LRU链表尾部的一些缓存页会很快的被淘汰掉，也就是所谓的劣币驱逐良币，会大大降低缓存命中率。</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">情况2：有时可能会写一些需要扫描全表的查询语句（比如没有建立合适的索引或者压根儿没有WHERE子句的查询）。<br/>
扫描全表意味着什么？意味着将访问到该表所在的所有页！假设这个表中记录非常多的话，那该表会占用特别多的页，当需要访问这些页时，会把它们统统都加载到Buffer Pool中，这也就意味着吧唧一下，Buffer Pool中的所有页都被换了一次血，其他查询语句在执行时又得执行一次从磁盘加载到Buffer Pool的操作。而这种全表扫描的语句执行的频率也不高，每次执行都要把Buffer Pool中的缓存页换一次血，这严重的影响到其他查询对 Buffer Pool的使用，从而大大降低了缓存命中率。</p>
</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">总结一下上边说的可能降低Buffer Pool的两种情况：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">加载到Buffer Pool中的页不一定被用到；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">如果非常多的使用频率偏低的页被同时加载到Buffer Pool时，可能会把那些使用频率非常高的项从Buffer Pool中淘汰；</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">因为这两种情况的存在，InnoDB将<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">LRU链表</strong>按照一定比例分成两截，分别是：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">一部分存储使用频率非常高的缓存页，所以这部分链表叫做<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">热数据</strong>，或者称<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">young区域</strong>；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">一部分存储使用频率较低的缓存页，所以这部分链表叫做<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">冷数据</strong>，或者称<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">old区域</strong>；</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><img src="17-InnoDB的Buffer Pool_files/1 [3].jpg" type="image/jpeg" data-filename="1.jpg"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">LRU链表是按照某个比例分成两截的，不是某些节点固定是young区域的，某些节点固定是old区域的，随着程序的运行，某个节点所属的区域也可能发生变化。<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">对于InnoDB存储引擎，可以通过</strong>全局系统变量innodb_old_blocks_pct</strong>的值来确定<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">old区域</strong>在<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">LRU链表中所占的比例</strong>：<br/>
<img src="17-InnoDB的Buffer Pool_files/Image [1].png" type="image/png" data-filename="Image.png"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">从结果可以看出来，默认情况下，old区域在LRU链表中所占的比例是37%，这个比例是可以设置的，可以在启动时修改<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">innodb_old_blocks_pct</strong>参数来控制old区域在LRU链表中所占的比例，比方说这样修改配置文件：<img src="17-InnoDB的Buffer Pool_files/Image [2].png" type="image/png" data-filename="Image.png"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">在服务器运行期间，也可以修改这个系统变量值，这个系统变量是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">全局变量</strong>，修改后，会对所有客户端生效：<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">SET GLOBAL innodb_old_blocks_pct = 40;</strong></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">有了这个被划分成young和old区域的LRU链表之后，设计InnoDB的大叔就可以针对我们上边提到的两种可能降低缓存命中率的情况进行优化了：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">针对预读的页面可能不进行后续访情况的优化<br/>
当磁盘上的某个页面在<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">初次加载到Buffer Pool中</strong>的某个缓存页时，该缓存页对应的<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">控制块会被放到old区域的头部</strong>。这样针对预读到Buffer Pool却不进行后续访问的页面就会被逐渐从old区域逐出，而<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">不会影响young区域中被使用比较频繁的缓存页</strong>。</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">针对全表扫描时，短时间内访问大量使用频率非常低的页面情况的优化<br/>
InnoDB规定每次去页面中读取一条记录时，都算是访问一次页面，而一个页面中可能会包含很多条记录，也就是说读取完某个页面的记录就相当于访问了这个页面好多次。<br/>
在对某个处在old区域的缓存页进行第一次访问时就在它对应的控制块中记录下来这个访问时间，如果后续的访问时间与第一次访问的时间在某个时间间隔内，那么该页面就不会被从old区域移动到young区域的头部，否则将它移动到young区域的头部。上述的时间间隔是由系统变量innodb_old_blocks_time控制的：<img src="17-InnoDB的Buffer Pool_files/Image [3].png" type="image/png" data-filename="Image.png"/><br/>
该参数和innodb_old_blocks_pct一样，可以在服务器启动或者运行时设置。</p>
</li>
</ul>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">更进一步优化LRU链表</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">LRU链表这就说完了么？没有，早着呢～ 对于young区域的缓存页来说，我们每次访问一个缓存页就要把它移动到LRU链表的头部，这样开销是不是太大啦，毕竟在young区域的缓存页都是热点数据，也就是可能被经常访问的，这样频繁的对LRU链表进行节点移动操作是不是不太好啊？是的，为了解决这个问题其实我们还可以提出一些优化策略，比如只有被访问的缓存页位于young区域的1/4的后边，才会被移动到LRU链表头部，这样就可以降低调整LRU链表的频率，从而提升性能（也就是说如果某个缓存页对应的节点在young区域的1/4中，再次访问该缓存页时也不会将其移动到LRU链表头部）。还有很多其他的优化策略等。</p>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">其他的一些链表</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">为了更好的管理Buffer Pool中的缓存页，InnoDB中还有一些其他的链表，比如：<br/>
unzip LRU链表用于管理解压页；<br/>
zip clean链表用于管理没有被解压的压缩页；<br/>
zip free数组中每一个元素都代表一个链表，它们组成所谓的<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">伙伴系统</strong>来为压缩页提供内存空间等。</p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-6 刷新脏页到磁盘</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">后台有专门的线程每隔一段时间负责把脏页刷新到磁盘，这样可以不影响用户线程处理正常的请求。主要有两种刷新路径：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">从LRU链表的冷数据中刷新一部分页面到磁盘</strong><br/>
后台线程会定时从<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">LRU链表</strong>尾部开始扫描一些页面，扫描的页面数量可以通过系统变量<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">innodb_lru_scan_depth</strong>指定，如果从里面发现脏页，会把它们刷新到磁盘。这种刷新页面的方式被称之为<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">BUF_FLUSH_LRU</strong>。</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">从flush链表中刷新一部分页面到磁盘</strong><br/>
后台线程会定时从<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">flush链表</strong>中刷新一部分页面到磁盘，刷新的速率取决于当时系统是不是很繁忙。这种刷新方式称之为<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">BUF_FLUSH_LIST</strong>。</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">有时候后台线程刷新脏页的进度比较慢，导致用户线程在准备加载一个磁盘页到Buffer Pool时没有可用的缓存页，这时就会尝试看看LRU链表尾部有没有可以直接释放掉的未修改页面，如果没有的话会不得不将<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">LRU链表尾部</strong>的一个脏页同步刷新到磁盘（和磁盘交互是很慢的，这会降低处理用户请求的速度）。这种刷新单个页面到磁盘中的刷新方式被称之为<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">BUF_FLUSH_SINGLE_PAGE</strong>。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">当然，有时候系统特别繁忙时，也可能出现<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">用户线程</strong>批量的从<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">flush链表</strong>中刷新脏页的情况，很显然在处理用户请求过程中去刷新脏页是一种严重降低处理速度的行为（毕竟磁盘的速度满的要死），这属于一种迫不得已的情况，不过这得放在后边唠叨<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">redo日志的checkpoint</strong>时说了。</p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-7 多个Buffer Pool实例</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Buffer Pool</strong>本质是InnoDB向操作系统申请的一块儿连续的内存空间，在<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">多线程</strong>环境在，访问Buffer Pool中的各种链表都需要加锁处理，在Buffer Pool特别大而且多线程并发访问特别高的情况下，单一的Buffer Pool可能会影响请求处理速度。所以在Buffer Pool特别大的时候，可以把它拆分成<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">若干个小的Buffer Pool</strong>，每个Buffer Pool都称为一个<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">实例</strong>，它们都是独立的，独立的去申请内存空间，独立的管理各种链表，在多线程并发访问时不会互相影响，从而提高并发处理能力。可以在服务器启动时，通过设置<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">innodb_buffer_pool_instances</strong>的值来修改Buffer Pool实例的个数：<img src="17-InnoDB的Buffer Pool_files/Image [4].png" type="image/png" data-filename="Image.png"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><img src="17-InnoDB的Buffer Pool_files/1 [4].jpg" type="image/jpeg" data-filename="1.jpg"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">每个Buffer Pool占用的内存空间根据下面的公式计算出来：<br/>
<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">innodb_buffer_pool_size/innodb_buffer_pool_instances</strong></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">不过并不是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Buffer Pool实例</strong>越多越好，分别管理各个Buffer Pool也是需要性能开销的，<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">当innodb_buffer_pool_size的值小于1G时设置多个实例是无效的，InnoDB会默认把innodb_buffer_pool_instances的值改为1。</strong></p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-8 innodb_buffer_pool_chunk_size</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">在MySQL 5.7.5之前，Buffer Pool的大小只能在服务器启动时通过配置innodb_buffer_pool_size启动参数来调整大小，在服务器运行过程中是不允许调整该值的。不过设计MySQL的大叔在5.7.5以及之后的版本中支持了在服务器运行过程中调整Buffer Pool大小的功能，但是有一个问题，就是每次当我们要重新调整Buffer Pool大小时，都需要重新向操作系统申请一块连续的内存空间，然后将旧的Buffer Pool中的内容复制到这一块新空间，这是极其耗时的。所以设计MySQL的大叔们决定不再一次性为某个Buffer Pool实例向操作系统申请一大片连续的内存空间，而是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">以一个chunk为单位向操作系统申请空间</strong>。也就是说<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">一个Buffer Pool实例</strong>其实是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">由若干个chunk组成</strong>的，一个chunk就代表一片连续的内存空间，里边儿包含了若干缓存页与其对应的控制块，画个图表示就是这样：<img src="17-InnoDB的Buffer Pool_files/1 [5].jpg" type="image/jpeg" data-filename="1.jpg"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">上图代表的Buffer Pool就是由2个实例组成的，每个实例中又包含2个chunk。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">正是因为发明了这个chunk的概念，我们在服务器运行期间调整Buffer Pool的大小时就是以chunk为单位增加或者删除内存空间，而不需要重新向操作系统申请一片大的内存，然后进行缓存页的复制。这个所谓的chunk的大小是我们在启动操作MySQL服务器时通过<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">innodb_buffer_pool_chunk_size</strong>启动参数指定的，它的默认值是134217728，也就是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">128M</strong>。不过需要注意的是，<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">innodb_buffer_pool_chunk_size的值只能在服务器启动时指定，在服务器运行过程中是不可以修改的</strong>。</p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-9 配置Buffer Pool时的注意事项</h3>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">innodb_buffer_pool_size必须是innodb_buffer_pool_chunk_size × innodb_buffer_pool_instances的倍数</strong>（这主要是想保证每一个Buffer Pool实例中包含的chunk数量相同）；<br/>
如果我们指定的innodb_buffer_pool_size大于2G并且不是2G的整数倍，那么服务器会自动的把innodb_buffer_pool_size的值调整为2G的整数倍，比方说我们在启动服务器时指定的innodb_buffer_pool_size的值是9G：<br/>
mysqld --innodb-buffer-pool-size=9G --innodb-buffer-pool-instances=16<br/>
那么服务器会自动把innodb_buffer_pool_size的值调整为10G（10737418240字节）：<br/>
<img src="17-InnoDB的Buffer Pool_files/Image [5].png" type="image/png" data-filename="Image.png"/></p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">如果在服务器启动时，innodb_buffer_pool_chunk_size × innodb_buffer_pool_instances的值已经大于innodb_buffer_pool_size的值，那么innodb_buffer_pool_chunk_size的值会被服务器自动设置为innodb_buffer_pool_size/innodb_buffer_pool_instances的值</strong><br/>
比方说我们在启动服务器时指定的innodb_buffer_pool_size的值为2G，innodb_buffer_pool_instances的值为16，innodb_buffer_pool_chunk_size的值为256M：<br/>
mysqld --innodb-buffer-pool-size=2G --innodb-buffer-pool-instances=16 --innodb-buffer-pool-chunk-size=256M<br/>
由于256M × 16 = 4G，而4G &gt; 2G，所以innodb_buffer_pool_chunk_size值会被服务器改写为innodb_buffer_pool_size/innodb_buffer_pool_instances的值，也就是：2G/16 = 128M（134217728字节）。</p>
</li>
</ul>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-10 查看Buffer Pool的状态信息</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">MySQL提供了<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">SHOW ENGINE INNODB STATUS</strong>语句来查看关于InnoDB存储引擎运行过程中的一些状态信息，其中就包括Buffer Pool的一些信息：</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><img src="17-InnoDB的Buffer Pool_files/Image [6].png" type="image/png" data-filename="Image.png"/></p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Total memory allocated</strong>：代表Buffer Pool向操作系统申请的连续内存空间大小，包括全部控制块、缓存页、以及碎片的大小；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Dictionary memory allocated</strong>：为数据字典信息分配的内存空间大小，注意这个内存空间和Buffer Pool没啥关系，不包括在Total memory allocated中；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Buffer pool size</strong>：<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">代表该Buffer Pool可以容纳多少缓存页，注意，单位是页</strong>；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Free buffers</strong>：代表当前Buffer Pool还有多少空闲缓存页，也就是free链表中还有多少个节点；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Database pages</strong>：代表LRU链表中的页的数量，包含young和old两个区域的节点数量；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Old database pages</strong>：代表LRU链表old区域的节点数量；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Modified db pages</strong>：代表脏页数量，也就是flush链表中节点的数量；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Pending reads</strong>：正在等待从磁盘上加载到Buffer Pool中的页面数量；<br/>
当准备从磁盘中加载某个页面时，会先为这个页面在Buffer Pool中分配一个缓存页以及它对应的控制块，然后把这个控制块添加到LRU的old区域的头部，但是这个时候真正的磁盘页并没有被加载进来，Pending reads的值会跟着加1；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Pending writes LRU</strong>：即将从LRU链表中刷新到磁盘中的页面数量；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Pending writes flush list</strong>：即将从flush链表中刷新到磁盘中的页面数量；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Pending writes single page</strong>：即将以单个页面的形式刷新到磁盘中的页面数量；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Pages made young</strong>：代表LRU链表中曾经从old区域移动到young区域头部的节点数量；<br/>
这里需要注意，一个节点每次只有从old区域移动到young区域头部时才会将Pages made young的值加1，也就是说如果该节点本来就在young区域，由于它符合在young区域1/4后边的要求，下一次访问这个页面时也会将它移动到young区域头部，但这个过程并不会导致Pages made young的值加1；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Page made not young</strong>：在将innodb_old_blocks_time设置的值大于0时，首次访问或者后续访问某个处在old区域的节点时由于不符合时间间隔的限制而不能将其移动到young区域头部时，Page made not young的值会加1；<br/>
这里需要注意，对于处在young区域的节点，如果由于它在young区域的1/4处而导致它没有被移动到young区域头部，这样的访问并不会将Page made not young的值加1。</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">youngs/s</strong>：代表每秒从old区域被移动到young区域头部的节点数量；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">non-youngs/s</strong>：代表每秒由于不满足时间限制而不能从old区域移动到young区域头部的节点数量；<br/>
<img src="17-InnoDB的Buffer Pool_files/Image [7].png" type="image/png" data-filename="Image.png"/></p>
</li>
</ul>
<h2 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 34px; border-bottom: 1px solid #dbdbdb; color: #333;">总结</h2>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">innodb_buffer_pool_size：设置buffer pool大小<br/>
innodb_buffer_pool_instances：设置buffer pool实例的个数<br/>
innodb_buffer_pool_chunk_size：设置buffer pool实例中每个chunk的大小<br/>
innodb_old_blocks_time：设置间隔时间内访问该页不会把它移动到young区域头部<br/>
innodb_old_blocks_pct：设置LRU链表中old占整个链表的百分值<br/>
show engine innodb status\G：查看InnoDB存储引擎的状态，其中包含Buffer Pool的信息</p>
</div><center style="display:none !important;visibility:collapse !important;height:0 !important;white-space:nowrap;width:100%;overflow:hidden">%23%23%201%20%E7%BC%93%E5%AD%98%E7%9A%84%E9%87%8D%E8%A6%81%E6%80%A7%0A%E5%BD%93%E9%9C%80%E8%A6%81%E8%AE%BF%E9%97%AE%E6%9F%90%E4%B8%AA%E9%A1%B5%E7%9A%84%E6%95%B0%E6%8D%AE%E6%97%B6%EF%BC%8C%E5%B0%B1%E4%BC%9A%E6%8A%8A%E5%AE%8C%E6%95%B4%E7%9A%84%E9%A1%B5%E7%9A%84%E6%95%B0%E6%8D%AE%E5%85%A8%E9%83%A8%E5%8A%A0%E8%BD%BD%E5%88%B0%E5%86%85%E5%AD%98%E4%B8%AD%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AF%E8%AF%B4%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0A%23%23%202%20InnoDB%E7%9A%84Buffer%20Pool%0A%E5%9C%A8MySQL%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%90%AF%E5%8A%A8%E6%97%B6%EF%BC%8C%E5%90%91%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%94%B3%E8%AF%B7%E4%BA%86%E4%B8%80%E7%89%87%E8%BF%9E%E7%BB%AD%E7%9A%84%E5%86%85%E5%AD%98%EF%BC%8C%E5%8F%AB%E5%81%9A**Buffer%20Pool%EF%BC%88%E7%BC%93%E5%86%B2%E6%B1%A0%EF%BC%89**%E3%80%82%0ABuffer%20Pool%E7%9A%84%E9%BB%98%E8%AE%A4%E5%A4%A7%E5%B0%8F%E6%98%AF128M%EF%BC%8C%E6%9C%80%E5%B0%8F%E5%80%BC%E6%98%AF5M%EF%BC%8C%E5%8F%AF%E4%BB%A5%E9%80%9A%E8%BF%87%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%97%B6%E9%85%8D%E7%BD%AE**innodb_buffer_pool_size**%E5%8F%82%E6%95%B0%E7%9A%84%E5%80%BC%EF%BC%9A%0A!%5Bfc9d6bded8206f0da6971196ebaeed75.png%5D(en-resource%3A%2F%2Fdatabase%2F897%3A1)%0A%0A%23%23%23%202-1%20Buffer%20Pool%E5%86%85%E9%83%A8%E7%BB%84%E6%88%90%0ABuffer%20Pool%E4%B8%AD%E9%BB%98%E8%AE%A4%E7%9A%84**%E7%BC%93%E5%AD%98%E9%A1%B5**%E5%A4%A7%E5%B0%8F%E5%92%8C%E5%9C%A8%E7%A3%81%E7%9B%98%E4%B8%8A%E9%BB%98%E8%AE%A4%E7%9A%84%E9%A1%B5%E5%A4%A7%E5%B0%8F%E4%B8%80%E6%A0%B7%EF%BC%8C%E9%83%BD%E6%98%AF16KB%E3%80%82%E4%B8%BA%E4%BA%86%E7%AE%A1%E7%90%86%E7%BC%93%E5%AD%98%E9%A1%B5%EF%BC%8C%E6%AF%8F%E4%B8%AA%E7%BC%93%E5%AD%98%E9%A1%B5%E5%AF%B9%E5%BA%94%E4%B8%80%E4%B8%AA**%E6%8E%A7%E5%88%B6%E5%9D%97**%EF%BC%8C%E6%8E%A7%E5%88%B6%E5%9D%97%E4%B8%AD%E5%AD%98%E5%82%A8%E4%BA%86%E5%AF%B9%E5%BA%94%E7%BC%93%E5%AD%98%E9%A1%B5%E6%89%80%E5%B1%9E%E7%9A%84%E8%A1%A8%E7%A9%BA%E9%97%B4%E7%BC%96%E5%8F%B7%E3%80%81%E9%A1%B5%E5%8F%B7%E3%80%81%E7%BC%93%E5%AD%98%E9%A1%B5%E5%9C%A8Buffer%20Pool%E4%B8%AD%E7%9A%84%E5%9C%B0%E5%9D%80%E3%80%81%E9%93%BE%E8%A1%A8%E8%8A%82%E7%82%B9%E4%BF%A1%E6%81%AF%E3%80%81%E9%94%81%E7%9A%84%E4%BF%A1%E6%81%AF%E4%BB%A5%E5%8F%8ALSN%E4%BF%A1%E6%81%AF%E7%AD%89%E3%80%82%0A%0A%E5%AE%83%E4%BB%AC%E9%83%BD%E8%A2%AB%E5%AD%98%E6%94%BE%E5%88%B0Buffer%20Pool%E4%B8%AD%EF%BC%8C%E5%85%B6%E4%B8%AD%E6%8E%A7%E5%88%B6%E5%9D%97%E8%A2%AB%E5%AD%98%E6%94%BE%E5%88%B0Buffer%20Pool%E7%9A%84%E5%89%8D%E9%9D%A2%EF%BC%8C%E7%BC%93%E5%AD%98%E9%A1%B5%E8%A2%AB%E5%AD%98%E6%94%BE%E5%88%B0Buffer%20Pool%E7%9A%84%E5%90%8E%E9%9D%A2%EF%BC%9A!%5B3b142c7084874ed3523392ca49f55634.jpeg%5D(en-resource%3A%2F%2Fdatabase%2F899%3A1)%0A%0A%E5%B0%8F%E8%B4%B4%E5%A3%AB%EF%BC%9A%20%E6%AF%8F%E4%B8%AA%E6%8E%A7%E5%88%B6%E5%9D%97%E5%A4%A7%E7%BA%A6%E5%8D%A0%E7%94%A8%E7%BC%93%E5%AD%98%E9%A1%B5%E5%A4%A7%E5%B0%8F%E7%9A%845%25%EF%BC%8C%E5%9C%A8MySQL5.7.21%E8%BF%99%E4%B8%AA%E7%89%88%E6%9C%AC%E4%B8%AD%EF%BC%8C%E6%AF%8F%E4%B8%AA%E6%8E%A7%E5%88%B6%E5%9D%97%E5%8D%A0%E7%94%A8%E7%9A%84%E5%A4%A7%E5%B0%8F%E6%98%AF808%E5%AD%97%E8%8A%82%E3%80%82%E8%80%8C%E6%88%91%E4%BB%AC%E8%AE%BE%E7%BD%AE%E7%9A%84innodb_buffer_pool_size%E5%B9%B6%E4%B8%8D%E5%8C%85%E5%90%AB%E8%BF%99%E9%83%A8%E5%88%86%E6%8E%A7%E5%88%B6%E5%9D%97%E5%8D%A0%E7%94%A8%E7%9A%84%E5%86%85%E5%AD%98%E7%A9%BA%E9%97%B4%E5%A4%A7%E5%B0%8F%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AF%E8%AF%B4InnoDB%E5%9C%A8%E4%B8%BABuffer%20Pool%E5%90%91%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%94%B3%E8%AF%B7%E8%BF%9E%E7%BB%AD%E7%9A%84%E5%86%85%E5%AD%98%E7%A9%BA%E9%97%B4%E6%97%B6%EF%BC%8C%E8%BF%99%E7%89%87%E8%BF%9E%E7%BB%AD%E7%9A%84%E5%86%85%E5%AD%98%E7%A9%BA%E9%97%B4%E4%B8%80%E8%88%AC%E4%BC%9A%E6%AF%94innodb_buffer_pool_size%E7%9A%84%E5%80%BC%E5%A4%A75%25%E5%B7%A6%E5%8F%B3%E3%80%82%0A%0A%23%23%23%202-2%20free%E9%93%BE%E8%A1%A8%E7%9A%84%E7%AE%A1%E7%90%86%0A%E5%BD%93%E7%A3%81%E7%9B%98%E4%B8%8A%E7%9A%84%E9%A1%B5%E9%9C%80%E8%A6%81%E8%A2%AB%E7%BC%93%E5%AD%98%E5%88%B0Buffer%20Pool%E4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A%E4%BD%9C%E4%B8%BA%E4%B8%80%E4%B8%AA%E8%8A%82%E7%82%B9%E5%8A%A0%E5%85%A5%E5%88%B0%E4%B8%80%E4%B8%AA%E9%93%BE%E8%A1%A8%E4%B8%AD%EF%BC%8C%E5%9B%A0%E4%B8%BA%E8%BF%99%E4%B8%AA%E9%93%BE%E8%A1%A8%E8%8A%82%E7%82%B9%E5%AF%B9%E5%BA%94%E7%9A%84%E7%BC%93%E5%AD%98%E9%A1%B5%E9%83%BD%E6%98%AF%E9%9C%80%E8%A6%81%E8%A2%AB%E5%88%B7%E6%96%B0%E5%88%B0%E7%A3%81%E7%9B%98%E4%B8%8A%E7%9A%84%EF%BC%8C%E6%89%80%E4%BB%A5%E4%B9%9F%E5%8F%AB**flush%E9%93%BE%E8%A1%A8**%E3%80%82%0A!%5B8873184e74ad7c7a0c1ccd91382adf19.jpeg%5D(en-resource%3A%2F%2Fdatabase%2F903%3A1)%0A%0A%23%23%23%202-5%20LRU%E9%93%BE%E8%A1%A8%E7%9A%84%E7%AE%A1%E7%90%86%0A%0ABuffer%20Pool%E5%AF%B9%E5%BA%94%E7%9A%84%E5%86%85%E5%AD%98%E5%A4%A7%E5%B0%8F%E6%98%AF%E6%9C%89%E9%99%90%E7%9A%84%EF%BC%8C%E5%A6%82%E6%9E%9C%E9%9C%80%E8%A6%81%E7%BC%93%E5%AD%98%E7%9A%84%E9%A1%B5%E5%8D%A0%E7%94%A8%E7%9A%84%E5%86%85%E5%AD%98%E5%A4%A7%E5%B0%8F%E8%B6%85%E8%BF%87%E4%BA%86Buffer%20Pool%E5%A4%A7%E5%B0%8F%EF%BC%88free%E9%93%BE%E8%A1%A8%E4%B8%AD%E6%B2%A1%E6%9C%89%E5%A4%9A%E4%BD%99%E7%9A%84%E7%A9%BA%E9%97%B4%E7%BC%93%E5%AD%98%E9%A1%B5%EF%BC%89%EF%BC%8C%E9%82%A3%E4%B9%88%E9%9C%80%E8%A6%81%E4%BB%8E%E5%B0%86%E4%B8%8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98%E9%A1%B5%E6%B7%98%E6%B1%B0%E3%80%82%0A%0A%23%23%23%23%202-5-2%20%E5%88%92%E5%88%86%E5%8C%BA%E5%9F%9F%E7%9A%84LRU%E9%93%BE%E8%A1%A8%0A%0A*%20%E6%83%85%E5%86%B51%EF%BC%9AInnoDB%E6%8F%90%E4%BE%9B%E4%BA%86%E4%B8%80%E4%B8%AA%E6%9C%8D%E5%8A%A1%E2%80%94%E2%80%94**%E9%A2%84%E8%AF%BB%EF%BC%88%E8%8B%B1%E6%96%87%E5%90%8D%EF%BC%9Aread%20ahead%EF%BC%89**%E3%80%82%E6%89%80%E8%B0%93%E9%A2%84%E8%AF%BB%EF%BC%8C%E5%B0%B1%E6%98%AFInnoDB%E8%AE%A4%E4%B8%BA%E6%89%A7%E8%A1%8C%E5%BD%93%E5%89%8D%E7%9A%84%E8%AF%B7%E6%B1%82%E5%8F%AF%E8%83%BD%E4%B9%8B%E5%90%8E%E4%BC%9A%E8%AF%BB%E5%8F%96%E6%9F%90%E4%BA%9B%E9%A1%B5%E9%9D%A2%EF%BC%8C%E5%B0%B1%E9%A2%84%E5%85%88%E6%8A%8A%E5%AE%83%E4%BB%AC%E5%8A%A0%E8%BD%BD%E5%88%B0Buffer%20Pool%E4%B8%AD%E3%80%82%E6%A0%B9%E6%8D%AE%E8%A7%A6%E5%8F%91%E6%96%B9%E5%BC%8F%E7%9A%84%E4%B8%8D%E5%90%8C%EF%BC%8C%E9%A2%84%E8%AF%BB%E5%8F%88%E5%8F%AF%E4%BB%A5%E7%BB%86%E5%88%86%E4%B8%BA%E4%B8%8B%E8%BE%B9%E4%B8%A4%E7%A7%8D%EF%BC%9A%0Aa.%20%E7%BA%BF%E6%80%A7%E9%A2%84%E8%AF%BB%EF%BC%9AInnoDB%E6%8F%90%E4%BE%9B%E4%BA%86%E4%B8%80%E4%B8%AA%E5%85%A8%E5%B1%80%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8F**innodb_read_ahead_threshold**%EF%BC%8C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2%91%E7%8E%87%E8%BE%83%E4%BD%8E%E7%9A%84%E7%BC%93%E5%AD%98%E9%A1%B5%EF%BC%8C%E6%89%80%E4%BB%A5%E8%BF%99%E9%83%A8%E5%88%86%E9%93%BE%E8%A1%A8%E5%8F%AB%E5%81%9A**%E5%86%B7%E6%95%B0%E6%8D%AE**%EF%BC%8C%E6%88%96%E8%80%85%E7%A7%B0**old%E5%8C%BA%E5%9F%9F**%EF%BC%9B%0A%0A!%5B4fbac48b9e74b24450c2c2b06c3fb9f2.jpeg%5D(en-resource%3A%2F%2Fdatabase%2F905%3A1)%0A%0A**LRU%E9%93%BE%E8%A1%A8%E6%98%AF%E6%8C%89%E7%85%A7%E6%9F%90%E4%B8%AA%E6%AF%94%E4%BE%8B%E5%88%86%E6%88%90%E4%B8%A4%E6%88%AA%E7%9A%84%EF%BC%8C%E4%B8%8D%E6%98%AF%E6%9F%90%E4%BA%9B%E8%8A%82%E7%82%B9%E5%9B%BA%E5%AE%9A%E6%98%AFyoung%E5%8C%BA%E5%9F%9F%E7%9A%84%EF%BC%8C%E6%9F%90%E4%BA%9B%E8%8A%82%E7%82%B9%E5%9B%BA%E5%AE%9A%E6%98%AFold%E5%8C%BA%E5%9F%9F%E7%9A%84%EF%BC%8C%E9%9A%8F%E7%9D%80%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%90%E8%A1%8C%EF%BC%8C%E6%9F%90%E4%B8%AA%E8%8A%82%E7%82%B9%E6%89%80%E5%B1%9E%E7%9A%84%E5%8C%BA%E5%9F%9F%E4%B9%9F%E5%8F%AF%E8%83%BD%E5%8F%91%E7%94%9F%E5%8F%98%E5%8C%96%E3%80%82**%E5%AF%B9%E4%BA%8EInnoDB%E5%AD%98%E5%82%A8%E5%BC%95%E6%93%8E%EF%BC%8C%E5%8F%AF%E4%BB%A5%E9%80%9A%E8%BF%87**%E5%85%A8%E5%B1%80%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8Finnodb_old_blocks_pct**%E7%9A%84%E5%80%BC%E6%9D%A5%E7%A1%AE%E5%AE%9A**old%E5%8C%BA%E5%9F%9F**%E5%9C%A8**LRU%E9%93%BE%E8%A1%A8%E4%B8%AD%E6%89%80%E5%8D%A0%E7%9A%84%E6%AF%94%E4%BE%8B**%EF%BC%9A%0A!%5B095f43d344bc156612f6b47d1eb82dcd.png%5D(en-resource%3A%2F%2Fdatabase%2F907%3A1)%0A%0A%E4%BB%8E%E7%BB%93%E6%9E%9C%E5%8F%AF%E4%BB%A5%E7%9C%8B%E5%87%BA%E6%9D%A5%EF%BC%8C%E9%BB%98%E8%AE%A4%E6%83%85%E5%86%B5%E4%B8%8B%EF%BC%8Cold%E5%8C%BA%E5%9F%9F%E5%9C%A8LRU%E9%93%BE%E8%A1%A8%E4%B8%AD%E6%89%80%E5%8D%A0%E7%9A%84%E6%AF%94%E4%BE%8B%E6%98%AF37%25%EF%BC%8C%E8%BF%99%E4%B8%AA%E6%AF%94%E4%BE%8B%E6%98%AF%E5%8F%AF%E4%BB%A5%E8%AE%BE%E7%BD%AE%E7%9A%84%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%97%B6%E4%BF%AE%E6%94%B9**innodb_old_blocks_pct**%E5%8F%82%E6%95%B0%E6%9D%A5%E6%8E%A7%E5%88%B6old%E5%8C%BA%E5%9F%9F%E5%9C%A8LRU%E9%93%BE%E8%A1%A8%E4%B8%AD%E6%89%80%E5%8D%A0%E7%9A%84%E6%AF%94%E4%BE%8B%EF%BC%8C%E6%AF%94%E6%96%B9%E8%AF%B4%E8%BF%99%E6%A0%B7%E4%BF%AE%E6%94%B9%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%EF%BC%9A!%5Ba9eefee15b101050e9ef3e1588006c0b.png%5D(en-resource%3A%2F%2Fdatabase%2F909%3A1)%0A%0A%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E8%A1%8C%E6%9C%9F%E9%97%B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%E6%97%B6%E9%97%B4%EF%BC%8C%E5%A6%82%E6%9E%9C%E5%90%8E%E7%BB%AD%E7%9A%84%E8%AE%BF%E9%97%AE%E6%97%B6%E9%97%B4%E4%B8%8E%E7%AC%AC%E4%B8%80%E6%AC%A1%E8%AE%BF%E9%97%AE%E7%9A%84%E6%97%B6%E9%97%B4%E5%9C%A8%E6%9F%90%E4%B8%AA%E6%97%B6%E9%97%B4%E9%97%B4%E9%9A%94%E5%86%85%EF%BC%8C%E9%82%A3%E4%B9%88%E8%AF%A5%E9%A1%B5%E9%9D%A2%E5%B0%B1%E4%B8%8D%E4%BC%9A%E8%A2%AB%E4%BB%8Eold%E5%8C%BA%E5%9F%9F%E7%A7%BB%E5%8A%A8%E5%88%B0young%E5%8C%BA%E5%9F%9F%E7%9A%84%E5%A4%B4%E9%83%A8%EF%BC%8C%E5%90%A6%E5%88%99%E5%B0%86%E5%AE%83%E7%A7%BB%E5%8A%A8%E5%88%B0young%E5%8C%BA%E5%9F%9F%E7%9A%84%E5%A4%B4%E9%83%A8%E3%80%82%E4%B8%8A%E8%BF%B0%E7%9A%84%E6%97%B6%E9%97%B4%E9%97%B4%E9%9A%94%E6%98%AF%E7%94%B1%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8Finnodb_old_blocks_time%E6%8E%A7%E5%88%B6%E7%9A%84%EF%BC%9A!%5B06ff806472a416d98a2b937786d32c34.png%5D(en-resource%3A%2F%2Fdatabase%2F911%3A1)%0A%E8%AF%A5%E5%8F%82%E6%95%B0%E5%92%8Cinnodb_old_blocks_pct%E4%B8%80%E6%A0%B7%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%90%AF%E5%8A%A8%E6%88%96%E8%80%85%E8%BF%90%E8%A1%8C%E6%97%B6%E8%AE%BE%E7%BD%AE%E3%80%82%0A%0A%23%23%23%23%20%E6%9B%B4%E8%BF%9B%E4%B8%80%E6%AD%A5%E4%BC%98%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%8D%E8%BF%87%E8%BF%99%E5%BE%97%E6%94%BE%E5%9C%A8%E5%90%8E%E8%BE%B9%E5%94%A0%E5%8F%A8**redo%E6%97%A5%E5%BF%97%E7%9A%84checkpoint**%E6%97%B6%E8%AF%B4%E4%BA%86%E3%80%82%0A%0A%23%23%23%202-7%20%E5%A4%9A%E4%B8%AABuffer%20Pool%E5%AE%9E%E4%BE%8B%0A**Buffer%20Pool**%E6%9C%AC%E8%B4%A8%E6%98%AFInnoDB%E5%90%91%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%94%B3%E8%AF%B7%E7%9A%84%E4%B8%80%E5%9D%97%E5%84%BF%E8%BF%9E%E7%BB%AD%E7%9A%84%E5%86%85%E5%AD%98%E7%A9%BA%E9%97%B4%EF%BC%8C%E5%9C%A8**%E5%A4%9A%E7%BA%BF%E7%A8%8B**%E7%8E%AF%E5%A2%83%E5%9C%A8%EF%BC%8C%E8%AE%BF%E9%97%AEBuffer%20Pool%E4%B8%AD%E7%9A%84%E5%90%84%E7%A7%8D%E9%93%BE%E8%A1%A8%E9%83%BD%E9%9C%80%E8%A6%81%E5%8A%A0%E9%94%81%E5%A4%84%E7%90%86%EF%BC%8C%E5%9C%A8Buffer%20Pool%E7%89%B9%E5%88%AB%E5%A4%A7%E8%80%8C%E4%B8%94%E5%A4%9A%E7%BA%BF%E7%A8%8B%E5%B9%B6%E5%8F%91%E8%AE%BF%E9%97%AE%E7%89%B9%E5%88%AB%E9%AB%98%E7%9A%84%E6%83%85%E5%86%B5%E4%B8%8B%EF%BC%8C%E5%8D%95%E4%B8%80%E7%9A%84Buffer%20Pool%E5%8F%AF%E8%83%BD%E4%BC%9A%E5%BD%B1%E5%93%8D%E8%AF%B7%E6%B1%82%E5%A4%84%E7%90%86%E9%80%9F%E5%BA%A6%E3%80%82%E6%89%80%E4%BB%A5%E5%9C%A8Buffer%20Pool%E7%89%B9%E5%88%AB%E5%A4%A7%E7%9A%84%E6%97%B6%E5%80%99%EF%BC%8C%E5%8F%AF%E4%BB%A5%E6%8A%8A%E5%AE%83%E6%8B%86%E5%88%86%E6%88%90**%E8%8B%A5%E5%B9%B2%E4%B8%AA%E5%B0%8F%E7%9A%84Buffer%20Pool**%EF%BC%8C%E6%AF%8F%E4%B8%AABuffer%20Pool%E9%83%BD%E7%A7%B0%E4%B8%BA%E4%B8%80%E4%B8%AA**%E5%AE%9E%E4%BE%8B**%EF%BC%8C%E5%AE%83%E4%BB%AC%E9%83%BD%E6%98%AF%E7%8B%AC%E7%AB%8B%E7%9A%84%EF%BC%8C%E7%8B%AC%E7%AB%8B%E7%9A%84%E5%8E%BB%E7%94%B3%E8%AF%B7%E5%86%85%E5%AD%98%E7%A9%BA%E9%97%B4%EF%BC%8C%E7%8B%AC%E7%AB%8B%E7%9A%84%E7%AE%A1%E7%90%86%E5%90%84%E7%A7%8D%E9%93%BE%E8%A1%A8%EF%BC%8C%E5%9C%A8%E5%A4%9A%E7%BA%BF%E7%A8%8B%E5%B9%B6%E5%8F%91%E8%AE%BF%E9%97%AE%E6%97%B6%E4%B8%8D%E4%BC%9A%E4%BA%92%E7%9B%B8%E5%BD%B1%E5%93%8D%EF%BC%8C%E4%BB%8E%E8%80%8C%E6%8F%90%E9%AB%98%E5%B9%B6%E5%8F%91%E5%A4%84%E7%90%86%E8%83%BD%E5%8A%9B%E3%80%82%E5%8F%AF%E4%BB%A5%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%90%AF%E5%8A%A8%E6%97%B6%EF%BC%8C%E9%80%9A%E8%BF%87%E8%AE%BE%E7%BD%AE**innodb_buffer_pool_instances**%E7%9A%84%E5%80%BC%E6%9D%A5%E4%BF%AE%E6%94%B9Buffer%20Pool%E5%AE%9E%E4%BE%8B%E7%9A%84%E4%B8%AA%E6%95%B0%EF%BC%9A!%5Bb3564208cf13b15205d4191bf72d4cd2.png%5D(en-resource%3A%2F%2Fdatabase%2F913%3A0)%0A%0A!%5B4e6ae319253b31c987ce4dfcdf9ea47f.jpeg%5D(en-resource%3A%2F%2Fdatabase%2F915%3A0)%0A%0A%E6%AF%8F%E4%B8%AABuffer%20Pool%E5%8D%A0%E7%94%A8%E7%9A%84%E5%86%85%E5%AD%98%E7%A9%BA%E9%97%B4%E6%A0%B9%E6%8D%AE%E4%B8%8B%E9%9D%A2%E7%9A%84%E5%85%AC%E5%BC%8F%E8%AE%A1%E7%AE%97%E5%87%BA%E6%9D%A5%EF%BC%9A%0A**innodb_buffer_pool_size%2Finnodb_buffer_pool_instances**%0A%0A%E4%B8%8D%E8%BF%87%E5%B9%B6%E4%B8%8D%E6%98%AF**Buffer%20Pool%E5%AE%9E%E4%BE%8B**%E8%B6%8A%E5%A4%9A%E8%B6%8A%E5%A5%BD%EF%BC%8C%E5%88%86%E5%88%AB%E7%AE%A1%E7%90%86%E5%90%84%E4%B8%AABuffer%20Pool%E4%B9%9F%E6%98%AF%E9%9C%80%E8%A6%81%E6%80%A7%E8%83%BD%E5%BC%80%E9%94%80%E7%9A%84%EF%BC%8C**%E5%BD%93innodb_buffer_pool_size%E7%9A%84%E5%80%BC%E5%B0%8F%E4%BA%8E1G%E6%97%B6%E8%AE%BE%E7%BD%AE%E5%A4%9A%E4%B8%AA%E5%AE%9E%E4%BE%8B%E6%98%AF%E6%97%A0%E6%95%88%E7%9A%84%EF%BC%8CInnoDB%E4%BC%9A%E9%BB%98%E8%AE%A4%E6%8A%8Ainnodb_buffer_pool_instances%E7%9A%84%E5%80%BC%E6%94%B9%E4%B8%BA1%E3%80%82**%0A%0A%23%23%23%202-8%20innodb_buffer_pool_chunk_size%0A%0A%E5%9C%A8MySQL%205.7.5%E4%B9%8B%E5%89%8D%EF%BC%8CBuffer%20Pool%E7%9A%84%E5%A4%A7%E5%B0%8F%E5%8F%AA%E8%83%BD%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%90%AF%E5%8A%A8%E6%97%B6%E9%80%9A%E8%BF%87%E9%85%8D%E7%BD%AEinnodb_buffer_pool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E7%9A%84%E5%86%85%E5%AD%98%EF%BC%8C%E7%84%B6%E5%90%8E%E8%BF%9B%E8%A1%8C%E7%BC%93%E5%AD%98%E9%A1%B5%E7%9A%84%E5%A4%8D%E5%88%B6%E3%80%82%E8%BF%99%E4%B8%AA%E6%89%80%E8%B0%93%E7%9A%84chunk%E7%9A%84%E5%A4%A7%E5%B0%8F%E6%98%AF%E6%88%91%E4%BB%AC%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%93%8D%E4%BD%9CMySQL%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%97%B6%E9%80%9A%E8%BF%87**innodb_buffer_pool_chunk_size**%E5%90%AF%E5%8A%A8%E5%8F%82%E6%95%B0%E6%8C%87%E5%AE%9A%E7%9A%84%EF%BC%8C%E5%AE%83%E7%9A%84%E9%BB%98%E8%AE%A4%E5%80%BC%E6%98%AF134217728%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AF**128M**%E3%80%82%E4%B8%8D%E8%BF%87%E9%9C%80%E8%A6%81%E6%B3%A8%E6%84%8F%E7%9A%84%E6%98%AF%EF%BC%8C**innodb_buffer_pool_chunk_size%E7%9A%84%E5%80%BC%E5%8F%AA%E8%83%BD%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%90%AF%E5%8A%A8%E6%97%B6%E6%8C%87%E5%AE%9A%EF%BC%8C%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E8%A1%8C%E8%BF%87%E7%A8%8B%E4%B8%AD%E6%98%AF%E4%B8%8D%E5%8F%AF%E4%BB%A5%E4%BF%AE%E6%94%B9%E7%9A%84**%E3%80%82%0A%0A%23%23%23%202-9%20%E9%85%8D%E7%BD%AEBuffer%20Pool%E6%97%B6%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9%0A%0A*%20**innodb_buffer_pool_size%E5%BF%85%E9%A1%BB%E6%98%AFinnodb_buffer_pool_chunk_size%20%C3%97%20innodb_buffer_pool_instances%E7%9A%84%E5%80%8D%E6%95%B0**%EF%BC%88%E8%BF%99%E4%B8%BB%E8%A6%81%E6%98%AF%E6%83%B3%E4%BF%9D%E8%AF%81%E6%AF%8F%E4%B8%80%E4%B8%AABuffer%20Pool%E5%AE%9E%E4%BE%8B%E4%B8%AD%E5%8C%85%E5%90%AB%E7%9A%84chunk%E6%95%B0%E9%87%8F%E7%9B%B8%E5%90%8C%EF%BC%89%EF%BC%9B%0A%E5%A6%82%E6%9E%9C%E6%88%91%E4%BB%AC%E6%8C%87%E5%AE%9A%E7%9A%84innodb_buffer_pool_size%E5%A4%A7%E4%BA%8E2G%E5%B9%B6%E4%B8%94%E4%B8%8D%E6%98%AF2G%E7%9A%84%E6%95%B4%E6%95%B0%E5%80%8D%EF%BC%8C%E9%82%A3%E4%B9%88%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BC%9A%E8%87%AA%E5%8A%A8%E7%9A%84%E6%8A%8Ainnodb_buffer_pool_size%E7%9A%84%E5%80%BC%E8%B0%83%E6%95%B4%E4%B8%BA2G%E7%9A%84%E6%95%B4%E6%95%B0%E5%80%8D%EF%BC%8C%E6%AF%94%E6%96%B9%E8%AF%B4%E6%88%91%E4%BB%AC%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%97%B6%E6%8C%87%E5%AE%9A%E7%9A%84innodb_buffer_pool_size%E7%9A%84%E5%80%BC%E6%98%AF9G%EF%BC%9A%0Amysqld%20--innodb-buffer-pool-size%3D9G%20--innodb-buffer-pool-instances%3D16%0A%E9%82%A3%E4%B9%88%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BC%9A%E8%87%AA%E5%8A%A8%E6%8A%8Ainnodb_buffer_pool_size%E7%9A%84%E5%80%BC%E8%B0%83%E6%95%B4%E4%B8%BA10G%EF%BC%8810737418240%E5%AD%97%E8%8A%82%EF%BC%89%EF%BC%9A%0A!%5Bac463999d6ee622623122981375f16bb.png%5D(en-resource%3A%2F%2Fdatabase%2F919%3A0)%0A%0A*%20**%E5%A6%82%E6%9E%9C%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%90%AF%E5%8A%A8%E6%97%B6%EF%BC%8Cinnodb_buffer_pool_chunk_size%20%C3%97%20innodb_buffer_pool_instances%E7%9A%84%E5%80%BC%E5%B7%B2%E7%BB%8F%E5%A4%A7%E4%BA%8Einnodb_buffer_pool_size%E7%9A%84%E5%80%BC%EF%BC%8C%E9%82%A3%E4%B9%88innodb_buffer_pool_chunk_size%E7%9A%84%E5%80%BC%E4%BC%9A%E8%A2%AB%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%87%AA%E5%8A%A8%E8%AE%BE%E7%BD%AE%E4%B8%BAinnodb_buffer_pool_size%2Finnodb_buffer_pool_instances%E7%9A%84%E5%80%BC**%0A%E6%AF%94%E6%96%B9%E8%AF%B4%E6%88%91%E4%BB%AC%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%97%B6%E6%8C%87%E5%AE%9A%E7%9A%84innodb_buffer_pool_size%E7%9A%84%E5%80%BC%E4%B8%BA2G%EF%BC%8Cinnodb_buffer_pool_instances%E7%9A%84%E5%80%BC%E4%B8%BA16%EF%BC%8Cinnodb_buffer_pool_chunk_size%E7%9A%84%E5%80%BC%E4%B8%BA256M%EF%BC%9A%0Amysqld%20--innodb-buffer-pool-size%3D2G%20--innodb-buffer-pool-instances%3D16%20--innodb-buffer-pool-chunk-size%3D256M%0A%E7%94%B1%E4%BA%8E256M%20%C3%97%2016%20%3D%204G%EF%BC%8C%E8%80%8C4G%20%3E%202G%EF%BC%8C%E6%89%80%E4%BB%A5innodb_buffer_pool_chunk_size%E5%80%BC%E4%BC%9A%E8%A2%AB%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%94%B9%E5%86%99%E4%B8%BAinnodb_buffer_pool_size%2Finnodb_buffer_pool_instances%E7%9A%84%E5%80%BC%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AF%EF%BC%9A2G%2F16%20%3D%20128M%EF%BC%88134217728%E5%AD%97%E8%8A%82%EF%BC%89%E3%80%82%0A%0A%23%23%23%202-10%20%E6%9F%A5%E7%9C%8BBuffer%20Pool%E7%9A%84%E7%8A%B6%E6%80%81%E4%BF%A1%E6%81%AF%0AMySQL%E6%8F%90%E4%BE%9B%E4%BA%86**SHOW%20ENGINE%20INNODB%20STATUS**%E8%AF%AD%E5%8F%A5%E6%9D%A5%E6%9F%A5%E7%9C%8B%E5%85%B3%E4%BA%8EInnoDB%E5%AD%98%E5%82%A8%E5%BC%95%E6%93%8E%E8%BF%90%E8%A1%8C%E8%BF%87%E7%A8%8B%E4%B8%AD%E7%9A%84%E4%B8%80%E4%BA%9B%E7%8A%B6%E6%80%81%E4%BF%A1%E6%81%AF%EF%BC%8C%E5%85%B6%E4%B8%AD%E5%B0%B1%E5%8C%85%E6%8B%ACBuffer%20Pool%E7%9A%84%E4%B8%80%E4%BA%9B%E4%BF%A1%E6%81%AF%EF%BC%9A%0A%0A!%5Ba623b719ebad78bdef3ff505a915b93b.png%5D(en-resource%3A%2F%2Fdatabase%2F921%3A0)%0A%0A*%20**Total%20memory%20allocated**%EF%BC%9A%E4%BB%A3%E8%A1%A8Buffer%20Pool%E5%90%91%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%94%B3%E8%AF%B7%E7%9A%84%E8%BF%9E%E7%BB%AD%E5%86%85%E5%AD%98%E7%A9%BA%E9%97%B4%E5%A4%A7%E5%B0%8F%EF%BC%8C%E5%8C%85%E6%8B%AC%E5%85%A8%E9%83%A8%E6%8E%A7%E5%88%B6%E5%9D%97%E3%80%81%E7%BC%93%E5%AD%98%E9%A1%B5%E3%80%81%E4%BB%A5%E5%8F%8A%E7%A2%8E%E7%89%87%E7%9A%84%E5%A4%A7%E5%B0%8F%EF%BC%9B%0A*%20**Dictionary%20memory%20allocated**%EF%BC%9A%E4%B8%BA%E6%95%B0%E6%8D%AE%E5%AD%97%E5%85%B8%E4%BF%A1%E6%81%AF%E5%88%86%E9%85%8D%E7%9A%84%E5%86%85%E5%AD%98%E7%A9%BA%E9%97%B4%E5%A4%A7%E5%B0%8F%EF%BC%8C%E6%B3%A8%E6%84%8F%E8%BF%99%E4%B8%AA%E5%86%85%E5%AD%98%E7%A9%BA%E9%97%B4%E5%92%8CBuffer%20Pool%E6%B2%A1%E5%95%A5%E5%85%B3%E7%B3%BB%EF%BC%8C%E4%B8%8D%E5%8C%85%E6%8B%AC%E5%9C%A8Total%20memory%20allocated%E4%B8%AD%EF%BC%9B%0A*%20**Buffer%20pool%20size**%EF%BC%9A**%E4%BB%A3%E8%A1%A8%E8%AF%A5Buffer%20Pool%E5%8F%AF%E4%BB%A5%E5%AE%B9%E7%BA%B3%E5%A4%9A%E5%B0%91%E7%BC%93%E5%AD%98%E9%A1%B5%EF%BC%8C%E6%B3%A8%E6%84%8F%EF%BC%8C%E5%8D%95%E4%BD%8D%E6%98%AF%E9%A1%B5**%EF%BC%9B%0A*%20**Free%20buffers**%EF%BC%9A%E4%BB%A3%E8%A1%A8%E5%BD%93%E5%89%8DBuffer%20Pool%E8%BF%98%E6%9C%89%E5%A4%9A%E5%B0%91%E7%A9%BA%E9%97%B2%E7%BC%93%E5%AD%98%E9%A1%B5%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AFfree%E9%93%BE%E8%A1%A8%E4%B8%AD%E8%BF%98%E6%9C%89%E5%A4%9A%E5%B0%91%E4%B8%AA%E8%8A%82%E7%82%B9%EF%BC%9B%0A*%20**Database%20pages**%EF%BC%9A%E4%BB%A3%E8%A1%A8LRU%E9%93%BE%E8%A1%A8%E4%B8%AD%E7%9A%84%E9%A1%B5%E7%9A%84%E6%95%B0%E9%87%8F%EF%BC%8C%E5%8C%85%E5%90%AByoung%E5%92%8Cold%E4%B8%A4%E4%B8%AA%E5%8C%BA%E5%9F%9F%E7%9A%84%E8%8A%82%E7%82%B9%E6%95%B0%E9%87%8F%EF%BC%9B%0A*%20**Old%20database%20pages**%EF%BC%9A%E4%BB%A3%E8%A1%A8LRU%E9%93%BE%E8%A1%A8old%E5%8C%BA%E5%9F%9F%E7%9A%84%E8%8A%82%E7%82%B9%E6%95%B0%E9%87%8F%EF%BC%9B%0A*%20**Modified%20db%20pages**%EF%BC%9A%E4%BB%A3%E8%A1%A8%E8%84%8F%E9%A1%B5%E6%95%B0%E9%87%8F%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AFflush%E9%93%BE%E8%A1%A8%E4%B8%AD%E8%8A%82%E7%82%B9%E7%9A%84%E6%95%B0%E9%87%8F%EF%BC%9B%0A*%20**Pending%20reads**%EF%BC%9A%E6%AD%A3%E5%9C%A8%E7%AD%89%E5%BE%85%E4%BB%8E%E7%A3%81%E7%9B%98%E4%B8%8A%E5%8A%A0%E8%BD%BD%E5%88%B0Buffer%20Pool%E4%B8%AD%E7%9A%84%E9%A1%B5%E9%9D%A2%E6%95%B0%E9%87%8F%EF%BC%9B%0A%E5%BD%93%E5%87%86%E5%A4%87%E4%BB%8E%E7%A3%81%E7%9B%98%E4%B8%AD%E5%8A%A0%E8%BD%BD%E6%9F%90%E4%B8%AA%E9%A1%B5%E9%9D%A2%E6%97%B6%EF%BC%8C%E4%BC%9A%E5%85%88%E4%B8%BA%E8%BF%99%E4%B8%AA%E9%A1%B5%E9%9D%A2%E5%9C%A8Buffer%20Pool%E4%B8%AD%E5%88%86%E9%85%8D%E4%B8%80%E4%B8%AA%E7%BC%93%E5%AD%98%E9%A1%B5%E4%BB%A5%E5%8F%8A%E5%AE%83%E5%AF%B9%E5%BA%94%E7%9A%84%E6%8E%A7%E5%88%B6%E5%9D%97%EF%BC%8C%E7%84%B6%E5%90%8E%E6%8A%8A%E8%BF%99%E4%B8%AA%E6%8E%A7%E5%88%B6%E5%9D%97%E6%B7%BB%E5%8A%A0%E5%88%B0LRU%E7%9A%84old%E5%8C%BA%E5%9F%9F%E7%9A%84%E5%A4%B4%E9%83%A8%EF%BC%8C%E4%BD%86%E6%98%AF%E8%BF%99%E4%B8%AA%E6%97%B6%E5%80%99%E7%9C%9F%E6%AD%A3%E7%9A%84%E7%A3%81%E7%9B%98%E9%A1%B5%E5%B9%B6%E6%B2%A1%E6%9C%89%E8%A2%AB%E5%8A%A0%E8%BD%BD%E8%BF%9B%E6%9D%A5%EF%BC%8CPending%20reads%E7%9A%84%E5%80%BC%E4%BC%9A%E8%B7%9F%E7%9D%80%E5%8A%A01%EF%BC%9B%0A*%20**Pending%20writes%20LRU**%EF%BC%9A%E5%8D%B3%E5%B0%86%E4%BB%8ELRU%E9%93%BE%E8%A1%A8%E4%B8%AD%E5%88%B7%E6%96%B0%E5%88%B0%E7%A3%81%E7%9B%98%E4%B8%AD%E7%9A%84%E9%A1%B5%E9%9D%A2%E6%95%B0%E9%87%8F%EF%BC%9B%0A*%20**Pending%20writes%20flush%20list**%EF%BC%9A%E5%8D%B3%E5%B0%86%E4%BB%8Eflush%E9%93%BE%E8%A1%A8%E4%B8%AD%E5%88%B7%E6%96%B0%E5%88%B0%E7%A3%81%E7%9B%98%E4%B8%AD%E7%9A%84%E9%A1%B5%E9%9D%A2%E6%95%B0%E9%87%8F%EF%BC%9B%0A*%20**Pending%20writes%20single%20page**%EF%BC%9A%E5%8D%B3%E5%B0%86%E4%BB%A5%E5%8D%95%E4%B8%AA%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%BD%A2%E5%BC%8F%E5%88%B7%E6%96%B0%E5%88%B0%E7%A3%81%E7%9B%98%E4%B8%AD%E7%9A%84%E9%A1%B5%E9%9D%A2%E6%95%B0%E9%87%8F%EF%BC%9B%0A*%20**Pages%20made%20young**%EF%BC%9A%E4%BB%A3%E8%A1%A8LRU%E9%93%BE%E8%A1%A8%E4%B8%AD%E6%9B%BE%E7%BB%8F%E4%BB%8Eold%E5%8C%BA%E5%9F%9F%E7%A7%BB%E5%8A%A8%E5%88%B0young%E5%8C%BA%E5%9F%9F%E5%A4%B4%E9%83%A8%E7%9A%84%E8%8A%82%E7%82%B9%E6%95%B0%E9%87%8F%EF%BC%9B%0A%E8%BF%99%E9%87%8C%E9%9C%80%E8%A6%81%E6%B3%A8%E6%84%8F%EF%BC%8C%E4%B8%80%E4%B8%AA%E8%8A%82%E7%82%B9%E6%AF%8F%E6%AC%A1%E5%8F%AA%E6%9C%89%E4%BB%8Eold%E5%8C%BA%E5%9F%9F%E7%A7%BB%E5%8A%A8%E5%88%B0young%E5%8C%BA%E5%9F%9F%E5%A4%B4%E9%83%A8%E6%97%B6%E6%89%8D%E4%BC%9A%E5%B0%86Pages%20made%20young%E7%9A%84%E5%80%BC%E5%8A%A01%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AF%E8%AF%B4%E5%A6%82%E6%9E%9C%E8%AF%A5%E8%8A%82%E7%82%B9%E6%9C%AC%E6%9D%A5%E5%B0%B1%E5%9C%A8young%E5%8C%BA%E5%9F%9F%EF%BC%8C%E7%94%B1%E4%BA%8E%E5%AE%83%E7%AC%A6%E5%90%88%E5%9C%A8young%E5%8C%BA%E5%9F%9F1%2F4%E5%90%8E%E8%BE%B9%E7%9A%84%E8%A6%81%E6%B1%82%EF%BC%8C%E4%B8%8B%E4%B8%80%E6%AC%A1%E8%AE%BF%E9%97%AE%E8%BF%99%E4%B8%AA%E9%A1%B5%E9%9D%A2%E6%97%B6%E4%B9%9F%E4%BC%9A%E5%B0%86%E5%AE%83%E7%A7%BB%E5%8A%A8%E5%88%B0young%E5%8C%BA%E5%9F%9F%E5%A4%B4%E9%83%A8%EF%BC%8C%E4%BD%86%E8%BF%99%E4%B8%AA%E8%BF%87%E7%A8%8B%E5%B9%B6%E4%B8%8D%E4%BC%9A%E5%AF%BC%E8%87%B4Pages%20made%20young%E7%9A%84%E5%80%BC%E5%8A%A01%EF%BC%9B%0A%0A*%20**Page%20made%20not%20young**%EF%BC%9A%E5%9C%A8%E5%B0%86innodb_old_blocks_time%E8%AE%BE%E7%BD%AE%E7%9A%84%E5%80%BC%E5%A4%A7%E4%BA%8E0%E6%97%B6%EF%BC%8C%E9%A6%96%E6%AC%A1%E8%AE%BF%E9%97%AE%E6%88%96%E8%80%85%E5%90%8E%E7%BB%AD%E8%AE%BF%E9%97%AE%E6%9F%90%E4%B8%AA%E5%A4%84%E5%9C%A8old%E5%8C%BA%E5%9F%9F%E7%9A%84%E8%8A%82%E7%82%B9%E6%97%B6%E7%94%B1%E4%BA%8E%E4%B8%8D%E7%AC%A6%E5%90%88%E6%97%B6%E9%97%B4%E9%97%B4%E9%9A%94%E7%9A%84%E9%99%90%E5%88%B6%E8%80%8C%E4%B8%8D%E8%83%BD%E5%B0%86%E5%85%B6%E7%A7%BB%E5%8A%A8%E5%88%B0young%E5%8C%BA%E5%9F%9F%E5%A4%B4%E9%83%A8%E6%97%B6%EF%BC%8CPage%20made%20not%20young%E7%9A%84%E5%80%BC%E4%BC%9A%E5%8A%A01%EF%BC%9B%0A%E8%BF%99%E9%87%8C%E9%9C%80%E8%A6%81%E6%B3%A8%E6%84%8F%EF%BC%8C%E5%AF%B9%E4%BA%8E%E5%A4%84%E5%9C%A8young%E5%8C%BA%E5%9F%9F%E7%9A%84%E8%8A%82%E7%82%B9%EF%BC%8C%E5%A6%82%E6%9E%9C%E7%94%B1%E4%BA%8E%E5%AE%83%E5%9C%A8young%E5%8C%BA%E5%9F%9F%E7%9A%841%2F4%E5%A4%84%E8%80%8C%E5%AF%BC%E8%87%B4%E5%AE%83%E6%B2%A1%E6%9C%89%E8%A2%AB%E7%A7%BB%E5%8A%A8%E5%88%B0young%E5%8C%BA%E5%9F%9F%E5%A4%B4%E9%83%A8%EF%BC%8C%E8%BF%99%E6%A0%B7%E7%9A%84%E8%AE%BF%E9%97%AE%E5%B9%B6%E4%B8%8D%E4%BC%9A%E5%B0%86Page%20made%20not%20young%E7%9A%84%E5%80%BC%E5%8A%A01%E3%80%82%0A%0A*%20**youngs%2Fs**%EF%BC%9A%E4%BB%A3%E8%A1%A8%E6%AF%8F%E7%A7%92%E4%BB%8Eold%E5%8C%BA%E5%9F%9F%E8%A2%AB%E7%A7%BB%E5%8A%A8%E5%88%B0young%E5%8C%BA%E5%9F%9F%E5%A4%B4%E9%83%A8%E7%9A%84%E8%8A%82%E7%82%B9%E6%95%B0%E9%87%8F%EF%BC%9B%0A*%20**non-youngs%2Fs**%EF%BC%9A%E4%BB%A3%E8%A1%A8%E6%AF%8F%E7%A7%92%E7%94%B1%E4%BA%8E%E4%B8%8D%E6%BB%A1%E8%B6%B3%E6%97%B6%E9%97%B4%E9%99%90%E5%88%B6%E8%80%8C%E4%B8%8D%E8%83%BD%E4%BB%8Eold%E5%8C%BA%E5%9F%9F%E7%A7%BB%E5%8A%A8%E5%88%B0young%E5%8C%BA%E5%9F%9F%E5%A4%B4%E9%83%A8%E7%9A%84%E8%8A%82%E7%82%B9%E6%95%B0%E9%87%8F%EF%BC%9B%0A!%5B4456d8143703983efa321a69e92c9808.png%5D(en-resource%3A%2F%2Fdatabase%2F923%3A0)%0A%0A%0A%23%23%20%E6%80%BB%E7%BB%93%0A%0Ainnodb_buffer_pool_size%EF%BC%9A%E8%AE%BE%E7%BD%AEbuffer%20pool%E5%A4%A7%E5%B0%8F%0Ainnodb_buffer_pool_instances%EF%BC%9A%E8%AE%BE%E7%BD%AEbuffer%20pool%E5%AE%9E%E4%BE%8B%E7%9A%84%E4%B8%AA%E6%95%B0%0Ainnodb_buffer_pool_chunk_size%EF%BC%9A%E8%AE%BE%E7%BD%AEbuffer%20pool%E5%AE%9E%E4%BE%8B%E4%B8%AD%E6%AF%8F%E4%B8%AAchunk%E7%9A%84%E5%A4%A7%E5%B0%8F%0Ainnodb_old_blocks_time%EF%BC%9A%E8%AE%BE%E7%BD%AE%E9%97%B4%E9%9A%94%E6%97%B6%E9%97%B4%E5%86%85%E8%AE%BF%E9%97%AE%E8%AF%A5%E9%A1%B5%E4%B8%8D%E4%BC%9A%E6%8A%8A%E5%AE%83%E7%A7%BB%E5%8A%A8%E5%88%B0young%E5%8C%BA%E5%9F%9F%E5%A4%B4%E9%83%A8%0Ainnodb_old_blocks_pct%EF%BC%9A%E8%AE%BE%E7%BD%AELRU%E9%93%BE%E8%A1%A8%E4%B8%ADold%E5%8D%A0%E6%95%B4%E4%B8%AA%E9%93%BE%E8%A1%A8%E7%9A%84%E7%99%BE%E5%88%86%E5%80%BC%0Ashow%20engine%20innodb%20status%5CG%EF%BC%9A%E6%9F%A5%E7%9C%8BInnoDB%E5%AD%98%E5%82%A8%E5%BC%95%E6%93%8E%E7%9A%84%E7%8A%B6%E6%80%81%EF%BC%8C%E5%85%B6%E4%B8%AD%E5%8C%85%E5%90%ABBuffer%20Pool%E7%9A%84%E4%BF%A1%E6%81%AF</center></span>
</div></body></html> 